<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Whisper: alsa_io.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Whisper
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">alsa_io.h</div>  </div>
</div>
<div class="contents">
<a href="alsa__io_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef __ALSA_IO_H__</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define __ALSA_IO_H__ 1</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;<a class="code" href="sample__io_8h.html">sample_io.h</a>&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;alsa/asoundlib.h&gt;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00007"></a>00007 
<a name="l00008"></a><a class="code" href="classCAlsaIO.html">00008</a> <span class="keyword">class </span><a class="code" href="classCAlsaIO.html">CAlsaIO</a> : <span class="keyword">public</span> <a class="code" href="classISampleIO.html">ISampleIO</a>
<a name="l00009"></a>00009 {
<a name="l00010"></a>00010 <span class="keyword">public</span>:
<a name="l00011"></a>00011         <span class="comment">// for capture</span>
<a name="l00012"></a>00012         <a class="code" href="classCAlsaIO.html#ad0c5787350736de90c5860e6c13bdc40">CAlsaIO</a>(<a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> pAction, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pChannels);
<a name="l00013"></a>00013 
<a name="l00014"></a>00014         <span class="comment">// for playback</span>
<a name="l00015"></a>00015         <a class="code" href="classCAlsaIO.html#ad0c5787350736de90c5860e6c13bdc40">CAlsaIO</a>(<a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> pAction, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pChannels,
<a name="l00016"></a>00016                         <a class="code" href="structNAudioFormats_1_1SStreamInfo.html">NAudioFormats::SStreamInfo</a> pStreamInfo);
<a name="l00017"></a>00017 
<a name="l00018"></a>00018         <span class="comment">// for capture and playback</span>
<a name="l00019"></a>00019         <a class="code" href="classCAlsaIO.html#ad0c5787350736de90c5860e6c13bdc40">CAlsaIO</a>(<a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> pAction);
<a name="l00020"></a>00020         <span class="keyword">virtual</span> <a class="code" href="classCAlsaIO.html#a90523775a705f0cbf0d33cc22a9fee08">~CAlsaIO</a>();
<a name="l00021"></a>00021 
<a name="l00022"></a>00022         <span class="comment">/* START methods inherited by ISampleIO */</span>
<a name="l00023"></a>00023         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCAlsaIO.html#a38e4b858c7ca52ed729cac95f7591643">init</a>(<a class="code" href="properties__reader_8h.html#a67847fd00cb49d80dd45f61722eb9a43">CPropertiesReader</a> *pConfig);
<a name="l00024"></a>00024         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCAlsaIO.html#a75136c89effa2d17df301c34b558b6b3">destroy</a>();
<a name="l00025"></a>00025 
<a name="l00026"></a>00026         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCAlsaIO.html#a2bb1348b29dafd091c2b454d21ccb3a0">read</a>(<span class="keywordtype">void</span>** pData, <a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a>&amp; pAction, <span class="keywordtype">int</span> pTimeout = 1000);
<a name="l00027"></a>00027         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classCAlsaIO.html#a4add4f97167c28853c96280a91f47bdf">write</a>(<span class="keywordtype">void</span>* pData, <span class="keyword">const</span> <a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a>&amp; pAction, <span class="keywordtype">int</span> pLength);
<a name="l00028"></a>00028 
<a name="l00029"></a>00029         <span class="keyword">virtual</span> <a class="code" href="structNAudioFormats_1_1SStreamInfo.html">NAudioFormats::SStreamInfo</a> <a class="code" href="classCAlsaIO.html#ae2cd7fa1bdeaf8dc4e026fdeda3b62b4">getStreamInfo</a>();
<a name="l00030"></a>00030         <span class="comment">/* END methods inherited by ISampleIO */</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="keyword">private</span>:
<a name="l00033"></a><a class="code" href="classCAlsaIO.html#af025779080a15ea1a8d13009cf774a19">00033</a>         <span class="keyword">enum</span> <a class="code" href="classCAlsaIO.html#af025779080a15ea1a8d13009cf774a19">EInitError</a> {
<a name="l00034"></a><a class="code" href="classCAlsaIO.html#af025779080a15ea1a8d13009cf774a19a39200ffb564c53d358399b0e0bdb2261">00034</a>                 <a class="code" href="classCAlsaIO.html#af025779080a15ea1a8d13009cf774a19a39200ffb564c53d358399b0e0bdb2261">INIT_NO_ERROR</a>          = 0,
<a name="l00035"></a>00035 
<a name="l00036"></a>00036                 <span class="comment">// errors</span>
<a name="l00037"></a><a class="code" href="classCAlsaIO.html#af025779080a15ea1a8d13009cf774a19aa5f99b155a680b2cca0d64d49d450f5c">00037</a>                 <a class="code" href="classCAlsaIO.html#af025779080a15ea1a8d13009cf774a19aa5f99b155a680b2cca0d64d49d450f5c">INIT_FAILURE</a>           = 1,
<a name="l00038"></a><a class="code" href="classCAlsaIO.html#af025779080a15ea1a8d13009cf774a19a06154a4f365e2935cb5ef006f3a0f3e4">00038</a>                 <a class="code" href="classCAlsaIO.html#af025779080a15ea1a8d13009cf774a19a06154a4f365e2935cb5ef006f3a0f3e4">INIT_CAPTURE_ERROR</a>     = 2,
<a name="l00039"></a><a class="code" href="classCAlsaIO.html#af025779080a15ea1a8d13009cf774a19a89b4aa18a4dfb55a90c73e9ea6334147">00039</a>                 <a class="code" href="classCAlsaIO.html#af025779080a15ea1a8d13009cf774a19a89b4aa18a4dfb55a90c73e9ea6334147">INIT_PLAYBACK_ERROR</a>    = 3,
<a name="l00040"></a>00040         };
<a name="l00041"></a>00041 
<a name="l00042"></a><a class="code" href="classCAlsaIO.html#ac0bec0456ebe156dd7f91ce78f180cb1">00042</a>         <a class="code" href="classCAlsaIO.html#af025779080a15ea1a8d13009cf774a19">EInitError</a> <a class="code" href="classCAlsaIO.html#ac0bec0456ebe156dd7f91ce78f180cb1">mError</a>;
<a name="l00043"></a><a class="code" href="classCAlsaIO.html#a9534bcc011f1329f48bfd85f05dfa27a">00043</a>         <a class="code" href="classISampleIO.html#a33f1d3778c9c332648df649a73fdb44c">EAction</a> <a class="code" href="classCAlsaIO.html#a9534bcc011f1329f48bfd85f05dfa27a">mAction</a>;
<a name="l00044"></a>00044 
<a name="l00045"></a><a class="code" href="classCAlsaIO.html#a2b4f99e9e294a08333760c34a0b3f84e">00045</a>         <span class="keywordtype">bool</span> <a class="code" href="classCAlsaIO.html#a2b4f99e9e294a08333760c34a0b3f84e">mPlaybackPrepareForFirstTime</a>;
<a name="l00046"></a><a class="code" href="classCAlsaIO.html#a37c151e25b6049d7b8200c07a1119644">00046</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCAlsaIO.html#a37c151e25b6049d7b8200c07a1119644">mPlaybackChannels</a>;
<a name="l00047"></a><a class="code" href="classCAlsaIO.html#a3af9bf0b6f2e4060516b8c93b3b58faf">00047</a>         snd_pcm_t *<a class="code" href="classCAlsaIO.html#a3af9bf0b6f2e4060516b8c93b3b58faf">mPlaybackHandle</a>;
<a name="l00048"></a>00048 
<a name="l00049"></a><a class="code" href="classCAlsaIO.html#a9a638038a1cee4c8e4b9bf18ee1dc739">00049</a>         <span class="keywordtype">bool</span> <a class="code" href="classCAlsaIO.html#a9a638038a1cee4c8e4b9bf18ee1dc739">mCapturePrepareForFirstTime</a>;
<a name="l00050"></a><a class="code" href="classCAlsaIO.html#aa6c23d2d8e78a26d31a20569bc708c00">00050</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCAlsaIO.html#aa6c23d2d8e78a26d31a20569bc708c00">mCaptureChannels</a>;
<a name="l00051"></a><a class="code" href="classCAlsaIO.html#a6c3ab64007888a9ae062f4b7a92d8f5a">00051</a>         snd_pcm_t *<a class="code" href="classCAlsaIO.html#a6c3ab64007888a9ae062f4b7a92d8f5a">mCaptureHandle</a>;
<a name="l00052"></a><a class="code" href="classCAlsaIO.html#a83ad50108db82d97d312fe853d6418e2">00052</a>         <span class="keywordtype">char</span> *<a class="code" href="classCAlsaIO.html#a83ad50108db82d97d312fe853d6418e2">mCaptureBuffer</a>;
<a name="l00053"></a>00053 
<a name="l00054"></a><a class="code" href="classCAlsaIO.html#a57d951532a8acae23e8cd194cf5dc980">00054</a>         <a class="code" href="structNAudioFormats_1_1SStreamInfo.html">NAudioFormats::SStreamInfo</a> <a class="code" href="classCAlsaIO.html#a57d951532a8acae23e8cd194cf5dc980">mStreamInfo</a>;
<a name="l00055"></a><a class="code" href="classCAlsaIO.html#aa8c8c3677bd118325188b00f9e4784c2">00055</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCAlsaIO.html#aa8c8c3677bd118325188b00f9e4784c2">mBytePerSample</a>;
<a name="l00056"></a>00056 
<a name="l00057"></a>00057         <a class="code" href="classCAlsaIO.html#ad0c5787350736de90c5860e6c13bdc40">CAlsaIO</a>(<span class="keyword">const</span> <a class="code" href="classCAlsaIO.html">CAlsaIO</a>&amp; );
<a name="l00058"></a>00058         <a class="code" href="classCAlsaIO.html">CAlsaIO</a>&amp; <a class="code" href="classCAlsaIO.html#a1e07d80eac5a4344193c9d9d8136e898">operator=</a>(<span class="keyword">const</span> <a class="code" href="classCAlsaIO.html">CAlsaIO</a>&amp; );
<a name="l00059"></a>00059 
<a name="l00060"></a>00060         <span class="keywordtype">bool</span> <a class="code" href="classCAlsaIO.html#afccf825bb8ec3b411090960e9904a28a">initPlayback</a>();
<a name="l00061"></a>00061         <span class="keywordtype">bool</span> <a class="code" href="classCAlsaIO.html#a1fd661a3f7931688fc414b943f73c646">initCapture</a>();
<a name="l00062"></a>00062         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCAlsaIO.html#a6458693adf42e1d18886490f07b00971">getBytePerSample</a>();
<a name="l00063"></a>00063         snd_pcm_format_t <a class="code" href="classCAlsaIO.html#a1465ebb956bc278eb8f94713c077fc3b">getAlsaSndPcmFormat</a>();
<a name="l00064"></a>00064 };
<a name="l00065"></a>00065 
<a name="l00066"></a>00066 <span class="preprocessor">#endif </span><span class="comment">/* __ALSA_IO_H__ */</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 25 2012 22:00:39 for Whisper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
